package com.terren.webdig.setting.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.terren.webdig.basic.IBasicServiceSupport;
import com.terren.webdig.setting.entity.Function;
import com.terren.webdig.setting.entity.LoginUser;

public interface IFunctionService extends IBasicServiceSupport {

	/**
	 * 查询用户 功能
	 * 
	 * @param loginUser
	 * @return
	 * @throws Exception
	 */
	List<Function> getUserFunction(LoginUser loginUser) throws Exception;

	/**
	 * 将function 结果处理成 树状结构
	 * 
	 * @param functionList
	 * @return
	 */
	List<Function> dealFunction(List<Function> functionList);

	/**
	 * 初始化用户所有功能权限
	 * 
	 * @param loginUser
	 * @param functionList
	 * @throws Exception
	 */
	public void initUserFunction(LoginUser loginUser, List<Function> functionList) throws Exception;

	/**
	 * 获得跳转页面地址
	 * 
	 * @param sessionUser
	 * @param k
	 * @return
	 */
	public Function getResponseFunction(LoginUser sessionUser, String actionValue, String k,HttpServletRequest request);

	/**
	 * 查询出function列表中的所有信息
	 * 
	 * @param functionList
	 * @param
	 * @throws Exception
	 */
	public List<Function> getFunctionQuery(Function function) throws Exception;

	// 查询父节点名称的下拉列表
	public List<Function> getParentName(Function function) throws Exception;

	// K值校验
	public List<Function> getFunctionK(Function function) throws Exception;

	// 添加
	public void addFunction(Function function) throws Exception;

	public List<Function> deleteChildParentId(Function function) throws Exception;

	public Integer updateFunction(Function function) throws Exception;

	// 删除根据FunctionId删除信息
	public List<Function> deletefunction(Function function) throws Exception;

	// 获取所有父节点功能
	public List<Function> getParentFunctionList(Function function) throws Exception;

	// 获取所有子节点功能
	public List<Function> getChildFunctionList(Function function) throws Exception;

	public List<Function> getAllFunction(Function function) throws Exception;
}
